from myutils import TryDButils
from myutils import ReadYamlUtils
from myutils import ExcelUtils


class BankData:
    def login(self):
        # 创建数据库连接
        db = TryDButils.TryDButils()
        # 数据库查询账号密码
        date = db.select("select username,password from user")
        return date

    def reg(self):
        # 从yaml获取数据
        user = []
        date = ReadYamlUtils.read_yaml("registerData.yaml")
        for k in date.items():
            user.append(k)
        return user

    def addcard(self):
        # Excel获取数据
        cards = ExcelUtils.readExcel("银行卡数据.xlsx", 'Sheet1')
        return cards

    # 零钱理财五个都买一遍
    def payData(self):
        return ['/html/body/div[1]/div/main/div/div/div/div/div[2]/div/table/tbody/tr[1]/td[6]/button',
                '/html/body/div[1]/div/main/div/div/div/div/div[2]/div/table/tbody/tr[2]/td[6]/button',
                '/html/body/div[1]/div/main/div/div/div/div/div[2]/div/table/tbody/tr[3]/td[6]/button',
                '/html/body/div[1]/div/main/div/div/div/div/div[2]/div/table/tbody/tr[4]/td[6]/button',
                '/html/body/div[1]/div/main/div/div/div/div/div[2]/div/table/tbody/tr[5]/td[6]/button'
                ]

if __name__ == '__main__':
    # b = BankData()
    # print(BankData().addcard())
    print(BankData().reg())
    # print(BankData().addcard())
